<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
//3. 定义一个计算圆面积的函数areaOfCircle()，它有两个参数：r: 表示圆的半径；pi: 表示π的值，如果不传，则默认3.14。
		function areaOfCircle(r,pi){
			let s = pi*r*r;
			return s;
		}
		let s = areaOfCircle(6,3.14);
		console.log(s);
		console.log(areaOfCircle(2, 3.14));
		areaOfCircle();
		
		
		// call, apply
		console.log(areaOfCircle.call(null, 5, 3.14)); // 形参指的是？r,pi;实参指的是:5,4
		console.log(areaOfCircle.apply(null, [5, 3.14])); 
		</script>
	</body>
</html>
